package com.it.common;

import lombok.Data;

@Data
public class Result {

    private String code;

    private String msg;

    private Object data;

    public static Result success(String code,String msg,Object data){
        Result result = new Result();
        result.setCode(code);
        result.setData(data);
        result.setMsg(msg);
        return result;
    }

    public static Result success(String code,String msg){
        return success(code,msg,null);
    }

    public static Result success(String code,Object data){
        return success(code,null,data);
    }

    public static Result getinfo(String msg,Object data){
        return success(null,msg,data);
    }

    public static Result fail(String code,String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }


}
